package com.baidu.service.impl;

import com.baidu.entity.Conmmodity;
import com.baidu.mapper.ConmmodityMapper;
import com.baidu.service.ConmmodityService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @描述
 * @Author ConmmodityServiceImpl
 * @Date 2019/4/18 15:30
 **/
@Service("conmmodityService")
public class ConmmodityServiceImpl implements ConmmodityService {
    @Resource
    private ConmmodityMapper conmmodityMapper;
    /**
     * 查询所有商品信息
     * @return
     */
    @Override
    public List<Conmmodity> selectConmmodity() {
        return conmmodityMapper.selectConmmodity();
    }

    /**
     * 根据id查询商品信息
     * @param cid
     * @return
     */
    @Override
    public Conmmodity selectConmmodityById(Integer cid) {
        return conmmodityMapper.selectConmmodityById(cid);
    }

    /**
     * 根据商品名字查询商品信息
     * @param cname
     * @return
     */
    @Override
    public Conmmodity selectConmmodityCname(String cname) {
        return conmmodityMapper.selectConmmodityCname(cname);
    }
}
